import { Rule, RuleType } from '@midwayjs/decorator';
import { BasePageDto } from '../../mall/dto/base';

export class AddressPageDto extends BasePageDto {
  @Rule(RuleType.number().required().min(1))
  customerId: number;
}

export class CreateAddressDto {
  @Rule(RuleType.number().required())
  customerId: number;

  @Rule(RuleType.string().required())
  name: string;

  @Rule(RuleType.string().required())
  sex: string;

  @Rule(RuleType.string().required())
  phone: string;

  @Rule(RuleType.string().required())
  province: string;

  @Rule(RuleType.string().required())
  city: string;

  @Rule(RuleType.string().required())
  area: string;

  @Rule(RuleType.string().required())
  street: string;

  @Rule(RuleType.string().required())
  detail: string;

  isDefault: boolean;
}

export class UpdateAddressDto {
  @Rule(RuleType.number().required())
  id: number;

  name: string;
  sex: string;
  phone: string;
  province: string;
  city: string;
  area: string;
  street: string;
  detail: string;
  isDefault: boolean;
}
